package cn.lu.train.ui.activity;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import cn.lu.train.R;
import cn.lu.train.base.BaseActivity;
import cn.lu.train.util.sysui.StatusBarUtil;

public class NearByActivity extends BaseActivity{


    @BindView(R.id.tv_title_center)
    TextView tvTitleCen;
    @BindView(R.id.rv_near)
    RecyclerView mRecyclerView;

    @Override
    public int getLayout() {
        return R.layout.activity_nearby;
    }

    @Override
    protected void onCreated() {
        StatusBarUtil.setStatusBarColor(this, 0xfff9f9f9);
        StatusBarUtil.setStatusBarDarkTheme(this, true);
        tvTitleCen.setText("附近充电宝");
        tvTitleCen.setTextColor(0xff111111);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        BaseQuickAdapter<String, BaseViewHolder> adapter = new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_near) {
            @Override
            protected void convert(BaseViewHolder helper, String item) {

            }
        };
        mRecyclerView.setAdapter(adapter);

        List<String> listData = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            listData.add(null);
        }
        adapter.setNewData(listData);

        adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                Intent intent = new Intent(NearByActivity.this, NearByInfoActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    public void initData() {
    }
}